﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Projektarbete
{
    enum ItemTypes { Empty, HealthPotion, ManaPotion, Head, Chest, Leg, Arm, Hand, Shoe };

    class Item
    {
        protected bool consumable = false;
        public bool isConsumable
        {
            get { return consumable; }
        }

        protected bool equipable = false;
        public bool isEquipable
        {
            get { return equipable; }
        }
        
        protected bool sellable = true;

        protected int value = 0;
        public int getValue
        {
            get { return value; }
        }
        protected float weight = 0.0f;
        public float getWeight
        {
            get { return weight; }
        }
        protected float size = 0.0f;
        public float getSize
        {
            get { return size; }
        }

        protected string name = string.Empty;
        public string getName
        {
            get { return name; }
        }
        protected string description = string.Empty;
        public string getDescription
        {
            get { return description; }
        }
        protected ItemTypes type;
        public ItemTypes getType
        {
            get { return type; }
        }

        protected Texture2D texture;
        public Texture2D getTexture
        {
            get { return texture; }
        }

        protected ushort strength;
        public ushort getStrength
        {
            get { return strength; }
        }

        protected ushort agility;
        public ushort getAgility
        {
            get { return agility; }
        }

        public Item()
        {
            //isEquip = false;
        }
    }

    class Equip : Item
    {
        public Equip(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
        {
            consumable = false;
            equipable = true;

            this.name = name;
            this.description = description;
            this.value = price;
            this.weight = weight;
            this.size = size;
            this.texture = texture;

            this.agility = agilityBonus;
            this.strength = strengthBonus;
        }
    }

    class Head : Equip
    {
        public Head(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
            : base(name, description, price, weight, size, texture, strengthBonus, agilityBonus)
        {
            this.type = ItemTypes.Head;
        }
    }

    class Cuirass : Equip
    {
        public Cuirass(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
            : base(name, description, price, weight, size, texture, strengthBonus, agilityBonus)
        {
            this.type = ItemTypes.Chest;
        }
    }

    class Leg : Equip
    {
        public Leg(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
            : base(name, description, price, weight, size, texture, strengthBonus, agilityBonus)
        {
            this.type = ItemTypes.Leg;
        }
    }

    class Arm : Equip
    {
        public Arm(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
            : base(name, description, price, weight, size, texture, strengthBonus, agilityBonus)
        {
            this.type = ItemTypes.Arm;
        }
    }

    class Hand : Equip
    {
        public Hand(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
            : base(name, description, price, weight, size, texture, strengthBonus, agilityBonus)
        {
            this.type = ItemTypes.Hand;
        }
    }

    class Shoe : Equip
    {
        public Shoe(string name, string description, int price, float weight, float size, Texture2D texture, ushort strengthBonus, ushort agilityBonus)
            : base(name, description, price, weight, size, texture, strengthBonus, agilityBonus)
        {
            this.type = ItemTypes.Shoe;
        }
    }

    /// <summary>
    /// Consumable, like a potion
    /// </summary>
    class Consumable : Item
    {
        public Consumable(string name, string description, int price, float weight, float size, Texture2D texture)
        {
            consumable = true;
            equipable = false;

            this.name = name;
            this.description = description;
            this.value = price;
            this.weight = weight;
            this.size = size;
            this.texture = texture;
        }
    }

    class HealthPotion : Consumable
    {
        ushort healthRestored;
        public ushort HealthRestored
        {
            get { return healthRestored; }
        }

        public HealthPotion(string name, string description, ushort healthRestored, int price, float weight, float size, Texture2D texture)
            : base(name, description, price, weight, size, texture)
        {
            this.type = ItemTypes.HealthPotion;
            this.healthRestored = healthRestored;
        }
    }

    class ManaPotion : Consumable
    {
        ushort manaRestored; 
        public ushort ManaRestored
        {
            get { return manaRestored; }
        }

        public ManaPotion(string name, string description, ushort manaRestored, int price, float weight, float size, Texture2D texture)
            : base(name, description, price, weight, size, texture)
        {
            this.type = ItemTypes.ManaPotion;
            this.manaRestored = manaRestored;
        }
    }
}